-- 智兔app-客户流失
CREATE external TABLE jms_dm.dm_network_customer_loss_detail_dt(
  `input_date` date COMMENT '统计时间 运单录入时间',
  `network_code` string COMMENT '网点编码(寄件网点)',
  `network_name` string COMMENT '网点名称',
  `customer_code` string COMMENT '网点名称',
  `customer_name` string COMMENT '网点名称',
  `last_delivery_dt` date COMMENT '最后发货时间',
  `is_moment` tinyint COMMENT '是否当日发货',
  `is_loss` tinyint COMMENT '是否是流失客户',
  `is_active` tinyint COMMENT '是否是活跃客户',
  `is_silent` tinyint COMMENT '是否是沉默客户',
  `is_incr` tinyint COMMENT '是否是新增客户',
  `waybill_cnt` int COMMENT '客户发货量',
  `waybill_cnt_90` int COMMENT '近三个月发货量',
  `waybill_cnt_180` int COMMENT '近半年发货量')
COMMENT '智兔APP客户看板-客户流失明细'
PARTITIONED BY (
  `dt` string COMMENT '日时间分区-运单录入时间')
   STORED AS PARQUET
    LOCATION '/dw/hive/jms_dm.db/external/dm_network_customer_loss_detail_dt'
    TBLPROPERTIES (
        'discover.partitions' = 'false',
        'parquet.column.index.access' = 'true'
        );